function setBase(){
var base = document.documentElement.children[0].all.tags("BASE");
	if( base.length == 0 )return;
	base[0].href = location.href.match(/.+\//)[0];
}
function insertBASE(html,localDomain){
	if( html === null )html = document.documentElement.outerHTML;
	var href = location.protocol+'//'+(localDomain+"/"+location.pathname).replace("//","/")
	return html.replace(/(<head>)/i,"$1\n<BASE href='"+href+"' />\n");
}///////////////////////////////////////////////
setTimeout("setBase()",100);

